<?php
/**
 * Created by PhpStorm.
 * User: hp
 * Date: 2017/11/21
 * Time: 10:42
 */

namespace App\Modules\Trade\Services;
use App\Modules\Trade\Services\OrderService;
use App\Modules\OfficialAccount\Services\ForceSubscribeService;
use App\Modules\SendOrder\Services\SendOrderService;
use App\Modules\User\Services\UserService;
use App\Modules\Trade\Models\OrderDayStat;
use DB;

class OrderDayStatService
{

    /**
     * 查询日统计
     * @param  $params $distribution_channel_id
     */
    static function search($params, $is_all=false)
    {
        return OrderDayStat::search($params, $is_all);
    }
    
    /**
     * 账户级别查询日统计
     * @param  $params $distribution_channel_id
     */
    static function accountSearch($params, $is_all=false)
    {
    	return OrderDayStat::accountSearch($params, $is_all);
    }

    /**
     * 获取渠道汇总统计
     */
    static function getSumByChannelId($distribution_channel_id)
    {
        return OrderDayStat::getSumByChannelId($distribution_channel_id);
    }

    /**
     * 获取昨日渠道汇总统计
     */
    static function getYesterdaySumByChannelId($distribution_channel_id)
    {
        return OrderDayStat::getYesterdaySumByChannelId($distribution_channel_id);
    }

    /**
     * 获取当月渠道汇总统计
     */
    static function getCurrentMonthSumByChannelId($distribution_channel_id)
    {
        return OrderDayStat::getCurrentMonthSumByChannelId($distribution_channel_id);
    }

    /**
     * 获取上月渠道汇总统计
     */
    static function getLastMonthSumByChannelId($distribution_channel_id)
    {
        return OrderDayStat::getLastMonthSumByChannelId($distribution_channel_id);
    }

    /**
     * 根据渠道获取合计
     */
    static function getStatByChannel($params)
    {
        return OrderDayStat::getStatByChannel($params);
    }

    /**
     *
     */
    static function getAllGroupbyMonth()
    {
        return OrderDayStat::getAllGroupbyMonth();
    }


    /**
     * 获取外部渠道充值数据
     * @param array $params
     * @param bool $isAll
     */
    static function getOutPayData($params = [], $isAll = false) {
        return OrderDayStat::getOutPayData($params, $isAll);
    }

    static function getRechargeByChannel($distribution_channel,$time_range){
        return OrderDayStat::getRechargeByChannel($distribution_channel,$time_range);
    }

    static function getRechargeByChannels($distribution_channels,$time_range){
        return OrderDayStat::getRechargeByChannels($distribution_channels,$time_range);
    }
}